
package com.contactportal.tags;

import javax.servlet.http.HttpSession;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class InvalidateSession extends SimpleTagSupport {

    @Override
    public void doTag() throws JspException {
        JspWriter out = getJspContext().getOut();
        
        try {
                PageContext pc = (PageContext) getJspContext();
                HttpSession session = pc.getSession();
                session.invalidate();
        } catch (Exception ex) {
            throw new JspException("Error in InvalidateSession tag", ex);
        }
    }
}
